
package com.hlkj.pay.app.order;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

import com.hlkj.framework.common.pojo.CommonResult;
import com.hlkj.pay.dto.common.OrderStatusDto;
import com.hlkj.pay.infrastructure.model.order.PayOrderDO;
import com.hlkj.pay.vo.openapi.order.req.PayOrderQueryReq;
import com.hlkj.pay.vo.openapi.order.resp.PayOrderSubmitApiResp;
import com.hlkj.pay.vo.order.req.PayOrderParamReq;
import com.hlkj.pay.vo.order.req.PreOrderPayReq;
import com.hlkj.pay.vo.order.resp.PayOrderResp;
import com.hlkj.pay.vo.order.resp.PrePayOrderResp;

/**
 * @author HlpayTeam
 * @date 2024/10/09 13:50
 */
public interface IPayOrderAppService {

    /**
     * 提交支付订单
     * 
     * @param payOrderParamReq
     * @return
     */
    CommonResult<PayOrderSubmitApiResp> submitOrder(@Valid PayOrderParamReq payOrderParamReq);

    /**
     * 提交支付订单
     *
     * @param preOrderPayReq
     * @return
     */
    CommonResult<PayOrderResp> preSubmitOrder(PreOrderPayReq preOrderPayReq);

    /**
     * 订单状态查询
     * 
     * @param payOrderQueryReq
     * @return
     */
    CommonResult<PayOrderResp> queryOrder(PayOrderQueryReq payOrderQueryReq);

    /**
     * 关闭订单
     * 
     * @param payOrderQueryReq
     * @return
     */
    CommonResult<Void> closeOrder(PayOrderQueryReq payOrderQueryReq);

    /**
     * 订单状态通知回调
     * 
     * @param channelCode
     * @param accessCallBody
     * @return
     */

    String orderStatusCallBack(String channelCode, String providerCode, HttpServletRequest request);
    /**
     * 订单状态通知回调
     *
     * @param channelCode
     * @param accessCallBody
     * @return
     */

    String orderStatusCallBack(String channelCode, HttpServletRequest request);

    String merAuthStatusCallBack(String channelCode,HttpServletRequest request);

    String mchOrderStatusCallBack(String channelCode, String providerCode,String mchChannelCode, HttpServletRequest request);
    /**
     * 关闭订单状态回调
     * 
     * @param channelCode
     * @param accessCallBody
     * @return
     */
    String closeOrderCallBack(String channelCode, String providerCode, HttpServletRequest request);

    String closeOrderCallBack(String channelCode, String providerCode, String mchChannelCode,HttpServletRequest request);

    /**
     * 清算订单
     * @param channelCode
     * @param providerCode
     * @param request
     * @return
     */
    String csOrderCallBack(String channelCode, String providerCode, HttpServletRequest request);

    String diviceOrderCallBack(String channelCode, String providerCode,String batchNo, HttpServletRequest request);

    /**
     *
     * @param orderStatusDto
     */
    void processOrderStatusQuery(OrderStatusDto orderStatusDto,boolean system);
    void processOrderStatusQuery(List<PayOrderDO> payOrderList);

    /**
     * 获取支付订单
     *
     * @param payOrderNo
     * @return
     */
    CommonResult<PrePayOrderResp> queryOrder(String payOrderNo);

    /**
     * 获取支付订单
     *
     * @param payOrderNo
     * @return
     */
    CommonResult<String> queryRedirectUrl(String payOrderNo);
}
